<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE HTML>

<html>
	
  <head>
    
    <title>流程管理</title>
	<link href="<%=basePath %>/warehouse/css/button.css" rel="stylesheet" type="text/css" />
  </head>
  <base target="_self"></base>
  <body>
    <input type="hidden" id="flowCode" name="flowCode" value=""/>
    
    <table  style="width: 100%;height: 100%;">
  	
  	<tr valign="top">
  		<td>
  			<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	
    	<td width="100%"> 
    		<FONT size="6">流程管理</FONT> 
    		
    		
    	</td>
    </tr>
    
    <tr>
    	
     	
     	
     	<td valign="top" >
     <table border="0" cellpadding="0" cellspacing="5" width="100%" height="100%">
    	 <tr>
     		<td>
     	<s:fielderror id="errormessage" />
    	<form action="javascript:openUrlForDialog('enterflow.action?kindid='+ $('#kindid').attr('value') + '&kind='+$('#kind').attr('value'));"  >
    		
    		<table width="100%" height="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
		     		
		     		<tr>
		     			<td>流程信息  ID: 
		     			
		     			
		     			
		     			
		     			<input id="kindid" name="kindid" value="" type="text" autofocus="autofocus">
		     			<input type="hidden" id="kind" name="kind" value="<s:property value="kind"/>"/>
		     			
		     			<button type="submit" class="large button blue" >切换流程信息 ID</button>
		     			</td>
		     		</tr>
		     	</table> 
    		
    	</form>
		     	
     	</td>
     		</tr>
     	<tr>
     		<td>
     			<s:if test="state == 9">
     				<table style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
    border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc;width: 100%;">
    
    					<tr>
    						<td align="center">
    						<font color="red" size="20">单据已经被取消流程作废!</font>
    						
    						
    						</td>
    					</tr>
    
   					 </table>
     			
     			</s:if>
     		
     		</td>
     	</tr> 
 <tr>
     		<td>
			<s:if test="kind == 'FLOW.WAREHOUSE.RECEIPTLIST'">
				<table  style= "border:1px solid #ffffff;width: 100%" >
					<tr>
						<td width="105">用户ID:</td>
						<td>
							<a target="_blank" href="managereceiptlist_warehouse.action?searchStr=<s:property value="receiptlist.customerid_receiptlist"/>"><s:property value="receiptlist.customerid_receiptlist"/></a>
							 <FONT color="green"><s:property value="lastSalesDate"/></FONT>
							
						</td>
						
				
					</tr>
					
					<tr>
					
					
						<td>买家信息:</td>
						<td><s:property value="receiptlist.customerinfo_receiptlist"/></td>
					
					</tr>

				</table>
				
				<table  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table style="background-color:#f3f7fc;width: 100%; ">
												<tr>
													<td width="360">
													<s:if test="receiptlist.state_receiptlist == 9">
														<s>出单号:<s:property value="receiptlist.id_receiptlist"/></s>
														</s:if>
					
															<s:else>
															
															出单号:
															<a target="_blank" href="receiptlistinfo_warehouse.action?id=<s:property value="receiptlist.id_receiptlist"/>" title="<s:property value="receiptlist.id_receiptlist"/>"><s:property value="receiptlist.id_receiptlist"/></a>
															
														
															</s:else>
															
															<font color="red">快递单号:<s:property value="receiptlist.shipno_receiptlist"/></font>
															<s:if test="receiptlist.realshipprice_receiptlist != 0">
																(费用:<s:property value="receiptlist.realshipprice_receiptlist"/>)
															</s:if>
															
															<s:if test="receiptlist.profit_receiptlist != 0">
																<font color="red">利润:<s:property value="receiptlist.profit_receiptlist"/></font>
															</s:if>
													<td>
													
													</td>
													<td align="right">
														出单时间:<s:property value="receiptlist.date_receiptlist"/>
													</td>
													
												 	
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table border="1" cellpadding="0"  cellspacing="0" bordercolor="#f5f5f5" style="border-collapse:collapse; border-width:1px 0 0 1px;">
												<tr>
													<td width="515" >
													
													
													
													<s:iterator id="receiptList" value="receiptList">
														<table >
															<tr>
																<td width="105">
																 	
																	
																</td>
																<td width="62" height="62">
																 	<img alt="" src="<s:property value="#receiptList.image_receipt"/>" width="60" height="60"/>
																	
																</td>
																<td width="243">
																
																<a href="#" title="单价:<s:property value="#receiptList.price_receipt"/> 数量:<s:property value="#receiptList.number_receipt"/> 总价:<s:property value="#receiptList.total_receipt"/> 利润(未算邮费):<s:property value="#receiptList.profit_receipt"/>">
																<s:property value="#receiptList.goodsname_receipt"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
																<s:if test="#receiptList.number_receipt > 1">
																<font color="red">
																
																(<s:property value="#receiptList.number_receipt"/>件)
																</font>
																</s:if>
																<s:else>
																
																(<s:property value="#receiptList.number_receipt"/>件)
																
																</s:else>
																</td>
															</tr>
															
														</table>
													</s:iterator>
													
														
													</td>
													
													<td align="center">
														<s:property value="receiptlist.total_receiptlist"/></br>
														<font color="#cococo">(快递:<s:property value="receiptlist.shipprice_receiptlist"/>)</font>
													</td>
													
													<td align="center">
														<s:property value="receiptlist.customerid_receiptlist"/>
													</td>
													
													
													
													<td align="center">
													
															
														<s:property value="receiptlist.username_receiptlist"/>
														
														
														
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#receiptlistList.remark_receiptlist!=''">
									<tr>
										<td bgcolor="fff7d9">
										<table>
											<tr>
											<td bgcolor="fff7d9">
											备注：<s:property value="#receiptlistList.remark_receiptlist"/>
											
										</td>
										<td align="right"><a href="premodifyreceiptlist_warehouse.action?id=<s:property value="#receiptlistList.id_receiptlist"/>">修改</a>	</td>
										</tr>
										</table>
										
										</td>
									</tr>
									</s:if>
									
									
							</table>
				
				<table border="0" cellpadding="0"  cellspacing="0" width="100%"  style= "border:1px solid #ffffff;" >
					<tr>
					
						<td width="105">运费:</td>
						<td><s:property value="receiptlist.shipprice_receiptlist"/></td>
						
					</tr>
					<tr>
					<td>产品数量:</td>
						
						<td><s:property value="receiptlist.goodsnumber_receiptlist"/></td>
					
					</tr>

					<tr>
						<td>描述/备注:</td>
						<td>
						
							<FONT color="red"><s:property value="receiptlist.remark_receiptlist"/></FONT>
						</td>
						
				
					</tr>
					
				
					

				</table>
				
				
			
			</s:if>
    	
			
	
	</td>
     		</tr>
     		 <tr>
     		<td>
     		
		
     	</td>
     	</tr>
     	<s:iterator id="flowValuelistMap" value="flowValuelistMap">
		<tr>
     		<td>
     		
     		<s:if test="#flowValuelistMap.key == flowValue">
     			<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:red;
	   			 border-left-color:red;border-right-color:red;border-top-color:red" width="100%">
	     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
	     				<tr>
	     				
	     					<td align="center">
	     						ID: <s:property value="kindid"/> / <s:property value="#flowValuelist.cnname_flow"/> / <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).username_recordlist"/>
	     					</td>
	 
	     				</tr>
	     				
	     				
	     			</s:iterator>
	     		</table>
     		</s:if>
     		<s:elseif test="#flowValuelistMap.key == flowNextValue">
     			<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
	   			 border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc" width="100%">
	     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
	     				<tr>
	     				
	     					<td align="center">
	     					<s:if test="#flowValuelist.function_flow != '' && #flowValuelist.function_flow != 'null'">
	     					
	     						<a href="javascript:openUrlForDialog('<%=basePath %>/<s:property value="#flowValuelist.function_flow"/>?kind=<s:property value="kind"/>&kindid=<s:property value="kindid"/>&flowCode=<s:property value="#flowValuelist.code_flow"/>');">
	     							<s:property value="#flowValuelist.cnname_flow"/>
	     						</a></s:if>
	     						
	     					<s:else>
	     						
	     						<a href="javascript:openUrlForDialog('enterflow.action?flowCode=<s:property value="#flowValuelist.code_flow"/>&kind=<s:property value="kind"/>&kindid=<s:property value="kindid"/>');">
	     							<s:property value="#flowValuelist.cnname_flow"/>
	     						</a>
	     					</s:else>
	     					
	     					
     						
	     					</td>
	     				
	     				</tr>
	     				
	     				
	     			</s:iterator>
	     		</table>
     		
     		</s:elseif>
     		<s:else>
     		<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:#c0c0c0;
   			 border-left-color:#c0c0c0;border-right-color:#c0c0c0;border-top-color:#c0c0c0" width="100%">
     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
     				<tr>
     				
     					<td align="center">
     					<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow) == null">
     						<font color="#c0c0c0">
     							<s:property value="#flowValuelist.cnname_flow"/>
     						</font>
     						
     						
     						
     						
     					</s:if> 
     					<s:else>
     						
     						
	     						
     							<s:property value="#flowValuelist.cnname_flow"/> / <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).username_recordlist"/>
     							/ 时间: <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).date_recordlist"/> 
     						
     						
	     					
	     						
	     						<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).doublevalue_recordlist!=0">
	     							 <font color="red">
	     							 费用:<s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).doublevalue_recordlist"/>
	     							 </font>
     							</s:if> 
     							
     						<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).flowflag_recordlist == 1  && flowValuelistMapNoCancel.get(#flowValuelist.code_flow).useremail_recordlist == #session.operatorInfo.email_operator">
     						
     							<a href="javascript:openUrlForDialog('cancelflow.action?id=<s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).id_recordlist"/>');">取消本次操作</a>
     						</s:if>
     							
     						
     					
     					</s:else> 
     					
     						</td>
     				
     				</tr>
     				
     				
     			</s:iterator>
     		</table>
     		</s:else>
     		
     		
     		</td>
     		
     	</tr>
     	</s:iterator>
     	</table>
     	
     	
     	
     	
	</td>
</tr>
</table>
  		
  		</td>
  	</tr>
  	
  	<tr>
  	 	<td>
  	 		<table>
  	 			<s:iterator id="recorlistMap" value="recorlistMap">
  	 			
  	 			<tr>
  	 				<td>
  	 				
  	 				
  	 					<s:if test="#recorlistMap.value.flowflag_recordlist==9">
     						<s>
     						
     							<s:property value="flowCodeMap.get(#recorlistMap.value.code_recordlist).cnname_flow"/> / <s:property value="#recorlistMap.value.username_recordlist"/>
     							/ 时间: <s:property value="#recorlistMap.value.date_recordlist"/> 
     						</s>
     						</s:if> 
     						<s:else>
     							<s:property value="flowCodeMap.get(#recorlistMap.value.code_recordlist).cnname_flow"/> / <s:property value="#recorlistMap.value.username_recordlist"/>
     							/ 时间: <s:property value="#recorlistMap.value.date_recordlist"/> 
     						</s:else>
     						
     						<s:property value="flowCodeMap.get(#recorlistMap.value.id_recordlist).doublevalue_recordlist"/> 
     						
     						<s:if test="flowValuelistMapNoCancel.get(#recorlistMap.value.code_recordlist).doublevalue_recordlist!=0">
     							 <font color="red">
     							 费用:<s:property value="#recorlistMap.value.doublevalue_recordlist"/>
     							 </font>
     						</s:if> 
     						
     						
  	 					
  	 				</td>
  	 			</tr>
  	 			</s:iterator>
  	 		</table>
  		</td>
  	</tr>
  	 <tr>
  	 	<td>备注: <input type="text" size="50" maxlength="255"/></td>
  	 </tr>
  	 
  </table>

  </body>
  <script type="text/javascript">
  	function enterFlowSubmit(flowCode){
		
  		enterflowForm['flowCode'].value = flowCode; 
  		enterflowForm['flowCode'].submit();
  	}

	function checkKindid(){
		num = document.getElementById("kindid").value;
		if(isNaN(num)){
			document.getElementById("kindid").value="";
			return;
		}

		openUrlForDialog('enterflow.action?kindid='+ num + '&kindid=<s:property value="kind"/>');
		//enterflowForm.submit();
  	}

	
  </script>
</html>
